# encoding: utf-8
import os

DEBUG = True
SECRET_KEY = os.urandom(4)

DIALECT = 'mysql'
DRIVER = 'mysqldb'
USERNAME = 'root'
PASSWORD = '123456'
HOST = '127.0.0.1'
PORT = '3306'
DATABASE = 'book'
SQLALCHEMY_DATABASE_URI = "{}+{}://{}:{}@{}:{}/{}?charset=utf8".format(DIALECT, DRIVER, USERNAME, PASSWORD, HOST, PORT,
                                                                       DATABASE)
SQLALCHEMY_TRACK_MODIFICATIONS = False

SALT = 'huangdy170250'

# 用户session的过期时间 天
session_lifetime = 5

# 验证码列型   0 英文   1 中文
captcha_type = 1

# 验证码过期时间 分钟
captcha_time = 2

# 不使用 csrf
WTF_CSRF_ENABLED = False

# 一页的条数
page_size = 10

# 推荐内容的简介的长度
article_introduction_length = 45

# redis 配置
redis_config = {
    'host': 'localhost',
    'port': 6379,
    'decode_responses': True
}

redis_ex = 24 * 60 * 60  # redis过期时间（秒）
